<template>
    <div>
        <div class="item">
            <span>{{item}}</span>
            <button @click="delItem(index)">删除</button>
        </div>
    </div>
</template>

<script>
    export default {
        props:["item","index"],
        methods:{
            delItem(index){
                this.$eventBus.$emit("deleteItem",index);
            }
        },
    };
</script>

<style lang="scss" scoped>
    .item{
        display: flex;
        justify-content: space-between;
    }
</style>